import { createRouter, createWebHistory } from 'vue-router'
import AppLayout from '@/views/AppLayout.vue'
import ApplicationConfig from '@/views/ApplicationConfig.vue'
import KnowledgeMgmt from '@/views/KnowledgeMgmt.vue'
const routes = [
  {
    path: '/',
    redirect: '/home'
  },
  {
    path: '/home',
    name: 'Home',
    component: () => import('@/views/Home.vue')
  },
  {
    path: '/app/:id',
    component: AppLayout,
    children: [
      
      {
        path: 'config',
        name: 'ApplicationConfig',
        component: ApplicationConfig,
        props: (route) => ({ appData: route.meta.appData }) // 或者直接传递
      },
      {
        path: 'knowledge',
        name: 'KnowledgeMgmt',
        component: KnowledgeMgmt
      }
    ]
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})


export default router